package com.itheima.a02threadcase2;

public class ThreadDemo1 {
    public static void main(String[] args) {
        //多线程的实现方式2 实现Runnable接口

        //创建Runnable接口的实现类对象
        MyRunnable mr = new MyRunnable();

        //创建线程对象
        Thread t1 = new Thread(mr);
        Thread t2 = new Thread(mr);

        t1.setName("ThreadDemo1");
        t2.setName("ThreadDemo2");

        //启动线程
        t1.start();
        t2.start();
    }
}
